package com.dcm.security.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.SessionAttributes;

import java.util.Map;


/**
 * @Classname:
 * @Author Mengxiangjian
 * @Date: 2021/3/28 18:53
 * @Version V 1.0
 */
@RestController
@SessionAttributes("authorizationRequest")
public class ErrorController {
    private static final Logger log = LoggerFactory.getLogger(ErrorController.class);

    @RequestMapping("oauth/error")
    public String error(@RequestParam Map<String,String> parameters){
        String uri = parameters.get("redirect_uri");
        log.info("重定向:{}",uri);
        return "redirect"+uri+"?error=1";
    }
}
